package net.ming616.pattern.factory.factorymethod;

import net.ming616.pattern.factory.product.BaseProduct;

public class Client {

	public static BaseProduct createProduct(String productName) {
		Factory factory = null;
		if ("A".equals(productName)) {
			factory = new ProductAFactory();
		} else if ("B".equals(productName)) {
			factory = new ProductBFactory();
		} else if ("C".equals(productName)) {
			factory = new ProductCFactory();
		}
		BaseProduct product = factory.produce();
		return product;
	}

}
